package cn.com.weibo4j.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class Weibo4jConfig {

	public static final String client_ID = "241030424";

	public static final String client_SERCRET = "cf60521d4e9374e3bc9910e123abc4ba";

	public static final String redirect_URI = "http://wechat.sm1168.com/usercenter/login/1-login.html";

	public static final String baseURL = "https://api.weibo.com/2/";

	public static final String accessTokenURL = "https://api.weibo.com/oauth2/access_token";
	public static final String authorizeURL = "https:// api.weibo.com/oauth2/authorize";
	public static final String rmURL = "https://rm.api.weibo.com/2/";

	// 加载配置文件方式
	private static Properties props = new Properties();

	public static String getValue(String key) {
		return props.getProperty(key);
	}

	public static void updateProperties(String key, String value) {
		props.setProperty(key, value);
	}

	public static void main(String args[]) {
		try {
			Weibo4jConfig.props
					.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("config.properties"));
			System.out.println(Weibo4jConfig.getValue("client_ID"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
